.class public Lorg/microemu/app/util/MIDletOutputStreamRedirector;
.super Ljava/io/PrintStream;
.source "MIDletOutputStreamRedirector.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/microemu/app/util/MIDletOutputStreamRedirector$OutputStream2Log;
    }
.end annotation


# static fields
.field static class$org$microemu$app$util$MIDletOutputStreamRedirector:Ljava/lang/Class; = null

.field static class$org$microemu$app$util$MIDletOutputStreamRedirector$OutputStream2Log:Ljava/lang/Class; = null

.field public static final err:Ljava/io/PrintStream; = null

.field private static final keepMultiLinePrint:Z = true

.field public static final out:Ljava/io/PrintStream;


# instance fields
.field private isErrorStream:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 45
    invoke-static {}, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->outPrintStream()Ljava/io/PrintStream;

    move-result-object v0

    sput-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->out:Ljava/io/PrintStream;

    .line 47
    invoke-static {}, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->errPrintStream()Ljava/io/PrintStream;

    move-result-object v0

    sput-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->err:Ljava/io/PrintStream;

    .line 52
    sget-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$org$microemu$app$util$MIDletOutputStreamRedirector:Ljava/lang/Class;

    if-nez v0, :cond_0

    const-string v0, "org.microemu.app.util.MIDletOutputStreamRedirector"

    invoke-static {v0}, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    sput-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$org$microemu$app$util$MIDletOutputStreamRedirector:Ljava/lang/Class;

    :goto_0
    invoke-static {v0}, Lorg/microemu/log/Logger;->addLogOrigin(Ljava/lang/Class;)V

    .line 53
    sget-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$org$microemu$app$util$MIDletOutputStreamRedirector$OutputStream2Log:Ljava/lang/Class;

    if-nez v0, :cond_1

    const-string v0, "org.microemu.app.util.MIDletOutputStreamRedirector$OutputStream2Log"

    invoke-static {v0}, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    sput-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$org$microemu$app$util$MIDletOutputStreamRedirector$OutputStream2Log:Ljava/lang/Class;

    :goto_1
    invoke-static {v0}, Lorg/microemu/log/Logger;->addLogOrigin(Ljava/lang/Class;)V

    .line 54
    return-void

    .line 52
    :cond_0
    sget-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$org$microemu$app$util$MIDletOutputStreamRedirector:Ljava/lang/Class;

    goto :goto_0

    .line 53
    :cond_1
    sget-object v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->class$org$microemu$app$util$MIDletOutputStreamRedirector$OutputStream2Log:Ljava/lang/Class;

    goto :goto_1
.end method

.method private constructor <init>(Z)V
    .locals 1
    .parameter "error"

    .prologue
    .line 90
    new-instance v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector$OutputStream2Log;

    invoke-direct {v0, p1}, Lorg/microemu/app/util/MIDletOutputStreamRedirector$OutputStream2Log;-><init>(Z)V

    invoke-direct {p0, v0}, Ljava/io/PrintStream;-><init>(Ljava/io/OutputStream;)V

    .line 92
    iput-boolean p1, p0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->isErrorStream:Z

    .line 93
    return-void
.end method

.method static class$(Ljava/lang/String;)Ljava/lang/Class;
    .locals 2
    .parameter "x0"

    .prologue
    .line 52
    :try_start_0
    invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    return-object v1

    :catch_0
    move-exception v0

    .local v0, x1:Ljava/lang/ClassNotFoundException;
    new-instance v1, Ljava/lang/NoClassDefFoundError;

    invoke-direct {v1}, Ljava/lang/NoClassDefFoundError;-><init>()V

    invoke-virtual {v1, v0}, Ljava/lang/NoClassDefFoundError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    move-result-object v1

    throw v1
.end method

.method private static errPrintStream()Ljava/io/PrintStream;
    .locals 2

    .prologue
    .line 100
    new-instance v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;

    const/4 v1, 0x1

    invoke-direct {v0, v1}, Lorg/microemu/app/util/MIDletOutputStreamRedirector;-><init>(Z)V

    return-object v0
.end method

.method private static outPrintStream()Ljava/io/PrintStream;
    .locals 2

    .prologue
    .line 96
    new-instance v0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lorg/microemu/app/util/MIDletOutputStreamRedirector;-><init>(Z)V

    return-object v0
.end method


# virtual methods
.method public print(C)V
    .locals 0
    .parameter "c"

    .prologue
    .line 110
    invoke-super {p0, p1}, Ljava/io/PrintStream;->print(C)V

    .line 111
    return-void
.end method

.method public print(D)V
    .locals 0
    .parameter "d"

    .prologue
    .line 118
    invoke-super {p0, p1, p2}, Ljava/io/PrintStream;->print(D)V

    .line 119
    return-void
.end method

.method public print(F)V
    .locals 0
    .parameter "f"

    .prologue
    .line 122
    invoke-super {p0, p1}, Ljava/io/PrintStream;->print(F)V

    .line 123
    return-void
.end method

.method public print(I)V
    .locals 0
    .parameter "i"

    .prologue
    .line 126
    invoke-super {p0, p1}, Ljava/io/PrintStream;->print(I)V

    .line 127
    return-void
.end method

.method public print(J)V
    .locals 0
    .parameter "l"

    .prologue
    .line 130
    invoke-super {p0, p1, p2}, Ljava/io/PrintStream;->print(J)V

    .line 131
    return-void
.end method

.method public print(Ljava/lang/Object;)V
    .locals 0
    .parameter "obj"

    .prologue
    .line 134
    invoke-super {p0, p1}, Ljava/io/PrintStream;->print(Ljava/lang/Object;)V

    .line 135
    return-void
.end method

.method public print(Ljava/lang/String;)V
    .locals 0
    .parameter "s"

    .prologue
    .line 138
    invoke-super {p0, p1}, Ljava/io/PrintStream;->print(Ljava/lang/String;)V

    .line 139
    return-void
.end method

.method public print(Z)V
    .locals 0
    .parameter "b"

    .prologue
    .line 106
    invoke-super {p0, p1}, Ljava/io/PrintStream;->print(Z)V

    .line 107
    return-void
.end method

.method public print([C)V
    .locals 0
    .parameter "s"

    .prologue
    .line 114
    invoke-super {p0, p1}, Ljava/io/PrintStream;->print([C)V

    .line 115
    return-void
.end method

.method public println()V
    .locals 0

    .prologue
    .line 142
    invoke-super {p0}, Ljava/io/PrintStream;->println()V

    .line 143
    return-void
.end method

.method public println(C)V
    .locals 0
    .parameter "x"

    .prologue
    .line 150
    invoke-super {p0, p1}, Ljava/io/PrintStream;->println(C)V

    .line 151
    return-void
.end method

.method public println(D)V
    .locals 0
    .parameter "x"

    .prologue
    .line 158
    invoke-super {p0, p1, p2}, Ljava/io/PrintStream;->println(D)V

    .line 159
    return-void
.end method

.method public println(F)V
    .locals 0
    .parameter "x"

    .prologue
    .line 162
    invoke-super {p0, p1}, Ljava/io/PrintStream;->println(F)V

    .line 163
    return-void
.end method

.method public println(I)V
    .locals 0
    .parameter "x"

    .prologue
    .line 166
    invoke-super {p0, p1}, Ljava/io/PrintStream;->println(I)V

    .line 167
    return-void
.end method

.method public println(J)V
    .locals 0
    .parameter "x"

    .prologue
    .line 170
    invoke-super {p0, p1, p2}, Ljava/io/PrintStream;->println(J)V

    .line 171
    return-void
.end method

.method public println(Ljava/lang/Object;)V
    .locals 1
    .parameter "x"

    .prologue
    .line 175
    invoke-super {p0}, Ljava/io/PrintStream;->flush()V

    .line 176
    iget-boolean v0, p0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->isErrorStream:Z

    if-eqz v0, :cond_0

    .line 177
    invoke-static {p1}, Lorg/microemu/log/Logger;->error(Ljava/lang/Object;)V

    .line 184
    :goto_0
    return-void

    .line 179
    :cond_0
    invoke-static {p1}, Lorg/microemu/log/Logger;->info(Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public println(Ljava/lang/String;)V
    .locals 1
    .parameter "x"

    .prologue
    .line 188
    invoke-super {p0}, Ljava/io/PrintStream;->flush()V

    .line 189
    iget-boolean v0, p0, Lorg/microemu/app/util/MIDletOutputStreamRedirector;->isErrorStream:Z

    if-eqz v0, :cond_0

    .line 190
    invoke-static {p1}, Lorg/microemu/log/Logger;->error(Ljava/lang/String;)V

    .line 197
    :goto_0
    return-void

    .line 192
    :cond_0
    invoke-static {p1}, Lorg/microemu/log/Logger;->info(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public println(Z)V
    .locals 0
    .parameter "x"

    .prologue
    .line 146
    invoke-super {p0, p1}, Ljava/io/PrintStream;->println(Z)V

    .line 147
    return-void
.end method

.method public println([C)V
    .locals 0
    .parameter "x"

    .prologue
    .line 154
    invoke-super {p0, p1}, Ljava/io/PrintStream;->println([C)V

    .line 155
    return-void
.end method

.method public write(I)V
    .locals 0
    .parameter "b"

    .prologue
    .line 204
    invoke-super {p0, p1}, Ljava/io/PrintStream;->write(I)V

    .line 205
    return-void
.end method

.method public write([BII)V
    .locals 0
    .parameter "buf"
    .parameter "off"
    .parameter "len"

    .prologue
    .line 200
    invoke-super {p0, p1, p2, p3}, Ljava/io/PrintStream;->write([BII)V

    .line 201
    return-void
.end method
